package com.example.order.controller;

import com.example.order.entity.StockDTO;
import com.example.order.feign.StockClientFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 唐佳辉
 * @CreateTime： 2025-05-07-15:09
 * @Description:
 * @Version：1.0
 */
@RestController()
@RequestMapping("/order")

public class OrderController {



    @Autowired
    private StockClientFeign stockClientFeign;

    @GetMapping("/getOrder")
    public String order(){
        return  stockClientFeign.stock();
       // return "order";
    }

    @GetMapping("/getOrderDTO")
    public String getOrderDTO(StockDTO stockDTO){
        StockDTO build = StockDTO.builder().name("张三").count(1).phone("123456").address("北京").build();
        return stockClientFeign.getStockDTO(build);
    }
}
